.class public Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;
.super Landroid/view/animation/Animation;
.source "FlipImageView.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/zuimeia/ui/flipimageview/FlipImageView;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x1
    name = "FlipAnimator"
.end annotation


# instance fields
.field private camera:Landroid/graphics/Camera;

.field private centerX:F

.field private centerY:F

.field final synthetic this$0:Lcom/zuimeia/ui/flipimageview/FlipImageView;

.field private toDrawable:Landroid/graphics/drawable/Drawable;

.field private visibilitySwapped:Z


# direct methods
.method public constructor <init>(Lcom/zuimeia/ui/flipimageview/FlipImageView;)V
    .registers 3
    .param p1, "this$0"    # Lcom/zuimeia/ui/flipimageview/FlipImageView;

    .prologue
    .line 291
    iput-object p1, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->this$0:Lcom/zuimeia/ui/flipimageview/FlipImageView;

    invoke-direct {p0}, Landroid/view/animation/Animation;-><init>()V

    .line 292
    const/4 v0, 0x1

    invoke-virtual {p0, v0}, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->setFillAfter(Z)V

    .line 293
    return-void
.end method


# virtual methods
.method protected applyTransformation(FLandroid/view/animation/Transformation;)V
    .registers 14
    .param p1, "interpolatedTime"    # F
    .param p2, "t"    # Landroid/view/animation/Transformation;

    .prologue
    const/high16 v10, 0x43340000

    const-wide v8, 0x400921fb54442d18L

    const/4 v5, 0x0

    .line 307
    float-to-double v6, p1

    mul-double v2, v8, v6

    .line 308
    .local v2, "radians":D
    const-wide v6, 0x4066800000000000L

    mul-double/2addr v6, v2

    div-double/2addr v6, v8

    double-to-float v0, v6

    .line 310
    .local v0, "degrees":F
    iget-object v4, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->this$0:Lcom/zuimeia/ui/flipimageview/FlipImageView;

    # getter for: Lcom/zuimeia/ui/flipimageview/FlipImageView;->mIsRotationReversed:Z
    invoke-static {v4}, Lcom/zuimeia/ui/flipimageview/FlipImageView;->access$000(Lcom/zuimeia/ui/flipimageview/FlipImageView;)Z

    move-result v4

    if-eqz v4, :cond_1c

    .line 311
    neg-float v0, v0

    .line 320
    :cond_1c
    const/high16 v4, 0x3f000000

    cmpl-float v4, p1, v4

    if-ltz v4, :cond_39

    .line 321
    iget-object v4, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->this$0:Lcom/zuimeia/ui/flipimageview/FlipImageView;

    # getter for: Lcom/zuimeia/ui/flipimageview/FlipImageView;->mIsRotationReversed:Z
    invoke-static {v4}, Lcom/zuimeia/ui/flipimageview/FlipImageView;->access$000(Lcom/zuimeia/ui/flipimageview/FlipImageView;)Z

    move-result v4

    if-eqz v4, :cond_8b

    .line 322
    add-float/2addr v0, v10

    .line 327
    :goto_2b
    iget-boolean v4, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->visibilitySwapped:Z

    if-nez v4, :cond_39

    .line 328
    iget-object v4, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->this$0:Lcom/zuimeia/ui/flipimageview/FlipImageView;

    iget-object v6, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->toDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v4, v6}, Lcom/zuimeia/ui/flipimageview/FlipImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 329
    const/4 v4, 0x1

    iput-boolean v4, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->visibilitySwapped:Z

    .line 333
    :cond_39
    invoke-virtual {p2}, Landroid/view/animation/Transformation;->getMatrix()Landroid/graphics/Matrix;

    move-result-object v1

    .line 335
    .local v1, "matrix":Landroid/graphics/Matrix;
    iget-object v4, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->camera:Landroid/graphics/Camera;

    invoke-virtual {v4}, Landroid/graphics/Camera;->save()V

    .line 338
    iget-object v4, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->camera:Landroid/graphics/Camera;

    invoke-virtual {v4, v5, v5, v5}, Landroid/graphics/Camera;->translate(FFF)V

    .line 339
    iget-object v6, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->camera:Landroid/graphics/Camera;

    iget-object v4, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->this$0:Lcom/zuimeia/ui/flipimageview/FlipImageView;

    # getter for: Lcom/zuimeia/ui/flipimageview/FlipImageView;->mIsRotationXEnabled:Z
    invoke-static {v4}, Lcom/zuimeia/ui/flipimageview/FlipImageView;->access$100(Lcom/zuimeia/ui/flipimageview/FlipImageView;)Z

    move-result v4

    if-eqz v4, :cond_8d

    move v4, v0

    :goto_52
    invoke-virtual {v6, v4}, Landroid/graphics/Camera;->rotateX(F)V

    .line 340
    iget-object v6, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->camera:Landroid/graphics/Camera;

    iget-object v4, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->this$0:Lcom/zuimeia/ui/flipimageview/FlipImageView;

    # getter for: Lcom/zuimeia/ui/flipimageview/FlipImageView;->mIsRotationYEnabled:Z
    invoke-static {v4}, Lcom/zuimeia/ui/flipimageview/FlipImageView;->access$200(Lcom/zuimeia/ui/flipimageview/FlipImageView;)Z

    move-result v4

    if-eqz v4, :cond_8f

    move v4, v0

    :goto_60
    invoke-virtual {v6, v4}, Landroid/graphics/Camera;->rotateY(F)V

    .line 341
    iget-object v4, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->camera:Landroid/graphics/Camera;

    iget-object v6, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->this$0:Lcom/zuimeia/ui/flipimageview/FlipImageView;

    # getter for: Lcom/zuimeia/ui/flipimageview/FlipImageView;->mIsRotationZEnabled:Z
    invoke-static {v6}, Lcom/zuimeia/ui/flipimageview/FlipImageView;->access$300(Lcom/zuimeia/ui/flipimageview/FlipImageView;)Z

    move-result v6

    if-eqz v6, :cond_91

    .end local v0    # "degrees":F
    :goto_6d
    invoke-virtual {v4, v0}, Landroid/graphics/Camera;->rotateZ(F)V

    .line 342
    iget-object v4, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->camera:Landroid/graphics/Camera;

    invoke-virtual {v4, v1}, Landroid/graphics/Camera;->getMatrix(Landroid/graphics/Matrix;)V

    .line 343
    iget-object v4, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->camera:Landroid/graphics/Camera;

    invoke-virtual {v4}, Landroid/graphics/Camera;->restore()V

    .line 345
    iget v4, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->centerX:F

    neg-float v4, v4

    iget v5, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->centerY:F

    neg-float v5, v5

    invoke-virtual {v1, v4, v5}, Landroid/graphics/Matrix;->preTranslate(FF)Z

    .line 346
    iget v4, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->centerX:F

    iget v5, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->centerY:F

    invoke-virtual {v1, v4, v5}, Landroid/graphics/Matrix;->postTranslate(FF)Z

    .line 347
    return-void

    .line 324
    .end local v1    # "matrix":Landroid/graphics/Matrix;
    .restart local v0    # "degrees":F
    :cond_8b
    sub-float/2addr v0, v10

    goto :goto_2b

    .restart local v1    # "matrix":Landroid/graphics/Matrix;
    :cond_8d
    move v4, v5

    .line 339
    goto :goto_52

    :cond_8f
    move v4, v5

    .line 340
    goto :goto_60

    :cond_91
    move v0, v5

    .line 341
    goto :goto_6d
.end method

.method public initialize(IIII)V
    .registers 6
    .param p1, "width"    # I
    .param p2, "height"    # I
    .param p3, "parentWidth"    # I
    .param p4, "parentHeight"    # I

    .prologue
    .line 297
    invoke-super {p0, p1, p2, p3, p4}, Landroid/view/animation/Animation;->initialize(IIII)V

    .line 298
    new-instance v0, Landroid/graphics/Camera;

    invoke-direct {v0}, Landroid/graphics/Camera;-><init>()V

    iput-object v0, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->camera:Landroid/graphics/Camera;

    .line 299
    div-int/lit8 v0, p1, 0x2

    int-to-float v0, v0

    iput v0, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->centerX:F

    .line 300
    div-int/lit8 v0, p2, 0x2

    int-to-float v0, v0

    iput v0, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->centerY:F

    .line 301
    return-void
.end method

.method public setToDrawable(Landroid/graphics/drawable/Drawable;)V
    .registers 3
    .param p1, "to"    # Landroid/graphics/drawable/Drawable;

    .prologue
    .line 287
    iput-object p1, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->toDrawable:Landroid/graphics/drawable/Drawable;

    .line 288
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/zuimeia/ui/flipimageview/FlipImageView$FlipAnimator;->visibilitySwapped:Z

    .line 289
    return-void
.end method
